import {
    getVariType,
    isObject
} from '../libs/utils';

class Cell {
    constructor(rowIndex, colIndex, userData){
        this.userData = userData;
        let _info = userData || {};

        this.rowIndex = rowIndex;
        this.colIndex = colIndex;

        this.colspan = _info.colspan || 1;
        this.rowspan = _info.rowspan || 1;
        
        this.hidden = userData.hidden;

        this.style = _info.style;
        this.classList = _info.classList;

        if(isObject(userData)){
            this.text = _info.text;
        }else{
            this.text = userData;
        }
    }
}

export default Cell;